<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>暠雨</title>
    <link rel="stylesheet" href="__STATIC__/index/css/base.css">
    <link rel="stylesheet" href="__STATIC__/index/css/style.css">
    <script src="__STATIC__/admin/js/jquery-1.9.1.min.js"></script>
    <script src="__STATIC__/admin/assets/layer/layer.js" type="text/javascript"></script>
    <link href="__STATIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet" />
    <script src="__STATIC__/admin/js/jquery-1.9.1.min.js"></script>
    <script src="__STATIC__/admin/js/bootstrap.min.js"></script>
</head>

<body>
<div class="head-box">
    <div class="head wrap">
        <div class="logo fl"><a href=""><img src="__STATIC__/index/images/logo.png"></a></div>
        <div class="head-right fr">
            <div class="head-a fr">
                {if condition='$user'}
                <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-a.png"></a></div>
                <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-b.png"></a></div>
                <div class="tbt fl"><img src="__UPLOAD__/user/{$user.image_thumb}" style="width: 30px;">
                    <div class="hgt-btm">
                        <a href="{:url('user/collection',['user_id'=>$user.user_id])}">我的主页</a>
                        <a href="">消息</a>
                        <a href="">我的关注</a>
                        <a href="{:url('user/account',['user_id'=>$user.user_id])}">帐号设置</a>
                        <a href="{:url('user/logon')}">退出</a>
                    </div>
                </div>

                {else}
                <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-a.png"></a></div>
                <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-b.png"></a></div>
                <div class="head-a3 fl"><a href="{:url('login/index')}">登录</a></div>
                <div class="head-a4 fl"><a href="{:url('login/login')}">注册</a></div>
                {/if}


            </div>
            <div class="clearfix"></div>
            <div class="nav fr">
                <ul>
                    <li><a href="{:url('index/index')}">首页</a></li>
                    <li><a href="{:url('question/article')}">文章</a>
                    </li>
                </ul>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>


<div class="content">
    <div class="col-height"></div>
    <div class="focus-banner">
        <div class="wrap">
            <div class="focus-a1"><img src="__UPLOAD__/user/{$user.image_thumb}"
                                       style="width: 150px;border-radius: 100px"></div>
            <div class="focus-a2">{$user.user_name}</div>
            <div class="focus-a3">
                <div class="py-a fl">性别 {$user.gender==''?'未知':$user.gender==0?'男':'女'}</div>
                <div class="py-a  fl">居住地 {$user.address==''?'未知':$user.address}</div>
                <div class="py-b  fl">职业 {$user.occupation==''?'未知':$user.occupation}</div>
            </div>
            <div class="" style="margin-left: 300px;color: #fff;">简介: {$user.brief==''?'':$user.brief}</div>
        </div>
    </div>

    <div class="focus-b-box">
        <div class="focus-list">
            <div class="focus-title">{$user.user_name} 的文章</div>
        </div>
        <div class="coll-box">
            <ul class="col-ul">

                {foreach $questions as $item}

                <li>
                    <div class="col-list">
                        <div class="col-a fl"><a href="{:url('question/question',['q_id'=>$item.q_id,'user_id'=>$user.user_id])}">
                            <img src="__UPLOAD__/question/{$item.image_thumb}"></a></div>
                        <div class="col-b fl">
                            <div class="col-b1"><a href="{:url('question/question',['q_id'=>$item.q_id,'user_id'=>$user.user_id])}">
                                {$item.q_title} </a> <span style="font-size: 10px">点击{$item.click}</span> <span style="float:right;">
                                <a href="{:url('question/edite',['q_id'=>$item.q_id,'user_id'=>$user.user_id])}">修改</a>
                                <a href="javascript:;" class="q_del" data-qid="{$item.q_id}" data-uid="{$user.user_id}">删除</a>
                            </span></div>
                            <div class="col-b2"><img src="__UPLOAD__/user/{$user.image_thumb}"
                                                     style="width: 30px;border-radius: 100px;">{$user.user_name}<span>{$item.create_time|date="Y-m-d H:i:s",###}</span>
                            </div>
                        </div>
                        <div class="col-c">
                            <span><img src="__STATIC__/index/images/col-c1.jpg">0</span>
                            <span><img src="__STATIC__/index/images/col-c2.jpg">3</span>
                            <em><img src="__STATIC__/index/images/col-c3.jpg"></em>
                            <em><img src="__STATIC__/index/images/col-c4.jpg"></em>
                            <em><img src="__STATIC__/index/images/col-c5.jpg"></em>
                        </div>
                    </div>
                </li>

                {/foreach}
            </ul>
        </div>
        <div class="row">

            <div class="col-sm-6">
                <div class="dataTables_info">{$questions->render()}</div>
            </div>
        </div>    </div>
</div>

<div class="footer">
    <div class="wrap">
        <div class="foot">
            <div class="foot-left fl">
                <a href="">关于我们</a>
                <a href="">加入我们</a>
                <a href="contact.html">联系我们</a>
                <a href="">媒体采访</a>
            </div>
            <div class="foot-c fl"><a href=""><img src="__STATIC__/index/images/foot-logo.jpg"></a></div>
            <div class="foot-right fr">
                <a href="">同城活动</a>
                <a href="">课程资讯</a>
                <a href="">最新发布</a>
                <a href="">热门文章</a>
            </div>
        </div>
    </div>
</div>


<script src="__STATIC__/index/js/Action.js"></script>
<script>
    $(".pyl").click(function () {
        $(this).find(".tbq").slideToggle()
    });
    $('.q_del').on('click',function () {
        var that=$(this);


        layer.confirm('真的那么狠心吗?',{icon:3,title:'错误提示'},function (index) {
            del(that);
            layer.close(index);
        });

    });
    function del(that){
        var q_id=$(that).data('qid');
        var user_id=$(that).data('uid');
        var url="{:url('question/qdel')}";
        var data={q_id:q_id,user_id:user_id};
        $.post(url,data,function (res) {
            if(res.status==1){
                $(that).parent().parent().parent().parent().remove();
                layer.msg('删除成功',{
                    title:'提示',
                    icon:6
                })
            }else{
                layer.msg('删除失败',{
                    title:'提示',
                    icon:4
                })
            }
        },'json');
    };
</script>

</body>
</html>
